﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.HumanAffairs.Bases;
using TianShiProject.Models.Materials.RecipientsToAppls;
using Volo.Abp.Application.Services;

namespace TianShiProject.HumanAffairs.Bases
{
    public class BaseService : ApplicationService
    {
        private readonly IBaseRepository _baseRepository;
        public BaseService(IBaseRepository baseRepository)
        {
            _baseRepository = baseRepository;
        }

        #region 员工登记——查询分页显示
        /// <summary>
        /// 员工登记——查询分页显示
        /// </summary>
        /// <param name="Name"></param>
        /// <param name="Department"></param>
        /// <param name="Job"></param>
        /// <param name="Phone"></param>
        /// <param name="Type"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<BaseDto>> GetBasePageShow(string Name, int Department, int Job, string Phone, int Type, int pageindex = 1, int pagesize = 3)
        {
            return await _baseRepository.GetBasePageShow(Name, Department, Job, Phone, Type, pageindex, pagesize);
        }
        #endregion

        #region 员工登记——逻辑删除
        /// <summary>
        /// 员工登记——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeleteBase(int id)
        {

            return await _baseRepository.DeleteBase(id);
        }
        #endregion

        #region 员工登记——批量删除
        /// <summary>
        /// 员工登记——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<int> DeleteBatchBase(string ids)
        {
            return await _baseRepository.DeleteBatchBase(ids);
        }
        #endregion

        #region 员工登记——编辑
        /// <summary>
        /// 员工登记——编辑
        /// </summary>
        /// <param name="baseDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateBase(BaseDto baseDto)
        {
            return await _baseRepository.PutUpdateBase(baseDto);
        }
        #endregion

        #region 员工登记——添加
        /// <summary>
        /// 员工登记——添加
        /// </summary>
        /// <param name="baseDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddBase(BaseDto baseDto)
        {
            return await _baseRepository.PostAddBase(baseDto);
        }
        #endregion
    }
}
